package com.shyroke.service.serviceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shyroke.entity.FriendDtoKey;
import com.shyroke.mapper.FriendDtoMapper;

@Service
public class FriendServiceImpl implements com.shyroke.service.FriendServiceI {

	@Autowired
	private FriendDtoMapper friendMapper;
	
	@Override
	public void save(FriendDtoKey friend) {
		friendMapper.insert(friend);
	}

	@Override
	public boolean isFriend(Integer userId, Integer sendUserId) {
	
		FriendDtoKey friend = friendMapper.isFriend(userId,sendUserId);
		
		return (friend!=null)?true:false;
	}

}
